import { Entity, Column, PrimaryColumn } from "typeorm";
/**
 * 附件表
 */
@Entity("BBL_ATTACH")
export class BblAttach {
  @PrimaryColumn({
    name: "ATTACH_ID",
    type: "varchar",
    length: 50,
    comment: "附件ID"
  })
  attId: string;

  @Column({
    name: "ATTACH_NAME",
    type: "varchar",
    length: 255,
    nullable: false,
    comment: "附件名称"
  })
  attName: string;

  /**
   * 附件扩展名
   */
  @Column({
    name: "ATTACH_EXT",
    type: "varchar",
    length: 255,
    nullable: true,
    comment: "附件扩展名"
  })
  attExt: string;

  /**
   * 附件状态, 0: 临时, 1: 正式
   */
  @Column({
    name: "ATTACH_STATE",
    type: "varchar",
    length: 1,
    nullable: true,
    comment: "附件状态, 0: 临时, 1: 正式"
  })
  attState: "0" | "1";

  /**
   * 附件正式路径。attStorageType=0时为本地文件路径，attStorageType=1时为云存储URL
   */
  @Column({
    name: "ATTACH_PATH",
    type: "varchar",
    length: 255,
    nullable: true,
    comment:
      "附件正式路径。attStorageType=0时为本地文件路径，attStorageType=1时为云存储URL"
  })
  attPath: string;

  /**
   * 临时路径
   */
  @Column({
    name: "ATTACH_TEMP_PATH",
    type: "varchar",
    length: 255,
    nullable: true,
    comment: "附件临时路径"
  })
  attTempPath: string;

  @Column({
    name: "ATTACH_MIME_TYPE",
    type: "varchar",
    length: 100,
    nullable: true,
    comment: "附件类型"
  })
  attMimeType: string;

  /**
   * 存储类型: 0-本地文件, 1-云存储URL
   */
  @Column({
    name: "ATTACH_STORAGE_TYPE",
    type: "varchar",
    length: 1,
    nullable: true,
    default: "0",
    comment: "存储类型: 0-本地文件, 1-云存储URL"
  })
  attStorageType: "0" | "1";

  /**
   * cos存储桶中的key
   */
  @Column({
    name: "ATTACH_COS_KEY",
    type: "varchar",
    length: 512,
    nullable: false,
    comment: "cos存储桶中的key"
  })
  attCosKey: string;
}
